import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store, { key } from "./store";
import "./assets/reset.less";

import { i18n } from "./i18next";
import { lang as t } from "./utils/crc32";
import { formater } from "./utils/dataFormater";
import { testPlugins } from "./utils/plugin";
import { registerElement } from './global'

const app = createApp(App);
app
  .use(store, key)
  .use(router)
  .use(i18n)
  .use(testPlugins)
  .mount("#app");

app.config.globalProperties.$tt = t;

//注册组件
registerElement(app)
//注册指令
formater(app, "formater");

// 定义了全局方法之后需要扩充类型
declare module "@vue/runtime-core" {
  interface ComponentCustomProperties {
    $tt: any;
  }
}
